package vn.allmobile.ambnews.loader;

import java.util.HashMap;
import java.util.Map;

import vn.allmobile.ambnews.R;


public abstract class BaseResult
{
	private static Map<ResultStatus, Integer> RESULT_STATUS_DES = new HashMap<ResultStatus,Integer>();
	private ResultStatus mResultStatus = ResultStatus.OK;
	static 
	  {
	    RESULT_STATUS_DES.put(ResultStatus.NETWROK_ERROR, Integer.valueOf(R.string.network_unavaliable));
	    RESULT_STATUS_DES.put(ResultStatus.SERVICE_ERROR, Integer.valueOf(R.string.service_unavailiable));
	    RESULT_STATUS_DES.put(ResultStatus.DATA_ERROR, Integer.valueOf(R.string.data_error));
	  }
   

  public static int getStatusDes(ResultStatus paramResultStatus)
  {
    return ((Integer)RESULT_STATUS_DES.get(paramResultStatus)).intValue();
  }

  protected abstract int getCount();

  public ResultStatus getResultStatus()
  {
    return this.mResultStatus;
  }

  public void setResultStatus(ResultStatus result)
  {
    this.mResultStatus = result;
  }

  public abstract BaseResult shallowClone();

  public enum ResultStatus
  {
      DATA_ERROR("DATA_ERROR", 2),OK("OK",3),NETWROK_ERROR("NETWROK_ERROR",0),SERVICE_ERROR("SERVICE_ERROR",1);
      static{
    	  ResultStatus[] arResultStatus = new ResultStatus[4];
          arResultStatus[0] = NETWROK_ERROR;
          arResultStatus[1] = SERVICE_ERROR;
          arResultStatus[2] = DATA_ERROR;
          arResultStatus[3] = OK;  
      }
       
      
      ResultStatus(String name, int value){
      }

  }
}
